<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('rd_device_broadcast', function (Blueprint $table) {
            $table->comment('广播设备');
            $table->bigIncrements('id');
            $table->string('code', 255)->comment('设备编码');
            $table->string('name', 255)->comment('设备名称');
            $table->unsignedBigInteger('server_id')->nullable()->comment('服务器id');
            $table->ipAddress('ip')->nullable()->comment('设备ip');
            $table->bigInteger('device_id')->nullable()->comment('设备编号');
            $table->bigInteger('rod_id')->comment('装置ID');
            $table->unsignedTinyInteger('status')->default(1)->comment('设备状态');
            $table->unsignedInteger('volume')->default(100)->comment('音量');
            $table->string('remarks', 255)->nullable()->comment('备注');
            $table->string('addr', 255)->comment('位置');
            $table->timestamps();
            $table->authorBy();
            $table->integer('stand_id')->nullable()->comment('站点id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('rd_device_broadcast');
    }
};
